class Solution:
    def wiggleSort(self, nums: list) -> None:
        """
        Do not return anything, modify nums in-place instead.
        """
        nums.sort()
        nums[::2], nums[1::2] = nums[(len(nums) - 1) // 2::-1], nums[:(len(nums) - 1) // 2:-1]
        # nums.sort(reverse=True)
        # nums[::2], nums[1::2] = nums[len(nums) // 2:], nums[:len(nums) // 2]


a = Solution()
b = [1, 2, 3]
a.wiggleSort(b)
print(b)
b = [1, 2, 3, 4]
a.wiggleSort(b)
print(b)
b = [4, 5, 5, 6]
a.wiggleSort(b)
print(b)
